﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using KPIS.GERP.GFMS.MODEL;

namespace KPIS.GERP.GFMS.IBLL
{
    public interface IBLL_FIM_Payroll
    {
        IList<M_FIM_Payroll> GetPayrolls(int? payroll_seq = null, string payroll_ref_no = null);
        IList<M_FIM_Payroll> GetPayrolls(int month, int year);
        IList<M_ICM_MasContact> GetIcmMasContact();
        bool CheckSentToPayment(int month, int year);
        int GetCurrentBgmYear();
        
        int InsertPayroll(M_FIM_Payroll model);
        void UpdatePayroll(M_FIM_Payroll model);
        void DeletePayroll(int payroll_seq, int emp_seq);
        void MarkAsSentToPayment(int month, int year, int emp_seq);
        void MarkAsNotSentToPayment(int month, int year, int emp_seq);
        
        IList<M_FIM_PayrollDeduction> GetPayrollDeductions(int? payroll_seq = null, int? payroll_deduction_seq = null, string payroll_ref_no = null);
        void InsertPayrollDeduction(M_FIM_PayrollDeduction model);
        void UpdatePayrollDeduction(M_FIM_PayrollDeduction model);
        void DeletePayrollDeduction(int payroll_deduction_seq, int emp_seq);

        DataTable PayrollTotal(int intMonth, int intYear);
        DataTable PayrollCombine(int flag);
        DataTable GridPayrollCombine(int intMonth, int intYear);
        string PaymentGroupName(int flag);
        decimal SumAmount(int flag);
        string SumDeduction(int intMonth, int intYear);

        void InsertSentpayment(M_FIM_Payroll_Sentpayment info);
        void InsertSentpaymentCombine(int ConId, string Name, decimal amount, int created_by, int intMonth, int intYear, int payrollSeq, int ChequeSeq);
        void sentpaymentCombineSeq(int? intPayrollDeductionSeq, int intpayrollSeq);
        void UpdatePayseqToCombine(int SentpaymentCombineSeq);
        void DeleteSentpayment(int intPaySeq, int SentpaymentCombineSeq);
        void DeletePayment(int intPaySeq);
        void DeleteMoneyReq(int intPaySeq);
        void DeleteMoneyDtlReq(int intPaySeq);
        void DeleteSentpaymentComb(int intMonth, int intYear);
        void UpdateFlagSentpayment(int? intPayrollDeductionSeq, int flagSentpayment);
        string RunningNumber();
        string RunningFlagGroup();
        string BgmyearToPayment(int SentpaymentCombineSeq);
        void InsertCheques(int paySeq, int? chequeSeq, decimal amount, int created_by);
    }
}
